﻿@model ARMS.Models.Booking

@{
    ViewBag.Title = "Make new booking";
}

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

<div>
@{
    List<SelectListItem> services = (List<SelectListItem>) ViewData.Eval(ARMS.BaseClasses.Factory.LSERVICES);
    ARMS.Models.Shop shop = (ARMS.Models.Shop) ViewData.Eval(ARMS.BaseClasses.Factory.CSHOP);
    string shopName = (shop != null) ? shop.name : "";
}
</div>
<h2>Make a booking (Step 1)</h2>

<div id="shopinfo">
    Shop: @{ @Html.Raw(String.Format("<span>{0}</span>", shopName)); }
</div>

@Html.ValidationSummary(true, "Please correct the errors and try again.")

@using(Html.BeginForm("FinaliseBooking", "Booking"))
{
<fieldset>
    <div class="detail">
    @{
        @Html.LabelFor(m => m.id)
        @Html.Raw("<span>NEW</span>")
        @Html.Raw("<br />")

        @Html.LabelFor(m => m.customername);
        @Html.TextBox("Customer ID", "", new { @id = "customerid", @name="customerid" })
        @Html.Raw("<span> OR </span>")
        
        @Html.TextBoxFor(m => m.customername)
        @Html.Raw("<br />")

        @Html.LabelFor(m => m.serviceid)
        @Html.DropDownListFor(m => m.serviceid, services, String.Empty)
        @Html.ValidationMessageFor(model => Model.serviceid)
        @Html.Raw("<br />");
      
        @Html.LabelFor(m => m.datestamp);
        @Html.TextBoxFor(m => m.datestamp, new { @type = "datetime-local" })
        @Html.Raw("<br />");
        @Html.ValidationMessageFor(m => m.datestamp)

        @Html.HiddenFor(model=> Model.shopid)
    }
    </div>
    <div class="footer-buttons clear">
        <button class="dialog-btn" id="cancel" type="button" value="Cancel">@{@Html.ActionLink("Cancel", "Index", "Booking");}</button>
        <button class="dialog-btn" id="save" type="submit" value="Save">Save</button>
    </div>
</fieldset>
<div class="instruction clear">
    <span class="red">* mandatory fields.</span><br />
</div>
<div class="instruction clear gray">
    <h4>Process creating the booking consist of two steps:</h4>
    <ul>
        <li>Finding the customer and service</li>
        <li>Chosing available staff for the booking</li>
    </ul>
</div>
}